package com.ruoyi.web.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.GuLogMapper;
import com.ruoyi.web.domain.GuLog;
import com.ruoyi.web.service.IGuLogService;

/**
 * 股票日志Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-18
 */
@Service
public class GuLogServiceImpl implements IGuLogService
{
    @Autowired
    private GuLogMapper guLogMapper;

    /**
     * 查询股票日志
     *
     * @param id 股票日志主键
     * @return 股票日志
     */
    @Override
    public GuLog selectGuLogById(String id)
    {
        return guLogMapper.selectGuLogById(id);
    }

    /**
     * 查询股票日志列表
     *
     * @param guLog 股票日志
     * @return 股票日志
     */
    @Override
    public List<GuLog> selectGuLogList(GuLog guLog)
    {
        return guLogMapper.selectGuLogList(guLog);
    }

    /**
     * 新增股票日志
     *
     * @param guLog 股票日志
     * @return 结果
     */
    @Override
    public int insertGuLog(GuLog guLog)
    {
        guLog.setCreateTime(DateUtils.getNowDate());
        guLog.setId(UUID.randomUUID().toString().replace("-", ""));
        return guLogMapper.insertGuLog(guLog);
    }

    /**
     * 修改股票日志
     *
     * @param guLog 股票日志
     * @return 结果
     */
    @Override
    public int updateGuLog(GuLog guLog)
    {
        guLog.setUpdateTime(DateUtils.getNowDate());
        return guLogMapper.updateGuLog(guLog);
    }

    /**
     * 批量删除股票日志
     *
     * @param ids 需要删除的股票日志主键
     * @return 结果
     */
    @Override
    public int deleteGuLogByIds(String[] ids)
    {
        return guLogMapper.deleteGuLogByIds(ids);
    }

    /**
     * 删除股票日志信息
     *
     * @param id 股票日志主键
     * @return 结果
     */
    @Override
    public int deleteGuLogById(String id)
    {
        return guLogMapper.deleteGuLogById(id);
    }
}
